import { createParamDecorator, ExecutionContext } from '@nestjs/common';

// 自定义装饰器，获取当前用户信息
export const UserEntityDecorator = createParamDecorator(
  (data: unknown, ctx: ExecutionContext) => {
    const request = ctx.switchToHttp().getRequest();
    return request.user; // 返回请求中的用户数据
  },
);
